import java.util.*;

public class h_5 {
    public static void main(String[] args) {
        int[] arr1 = {1,3,2,2,2};
        int[] arr2 = {3,4,5};
        String f2 = f2(arr1.length, arr2.length, arr1,arr2);
        System.out.println(f2);

    }

    public static String f2(int x,int y,int[] arr1,int [] arr2){
        int [] s=new int[x+y];
        for(int i=0;i<x;i++){
            s[i]=arr1[i];
        }
        for(int j=0;j<y;j++){
            s[x+j]=arr2[j];
        }
        Arrays.sort(s);
        HashMap<Integer,Integer> map=new HashMap<>();
        for (int val : s) {
            Integer count = map.get(val);
            if(map.containsKey(val)){
                map.put(val, count+1);
            }else{
                map.put(val, 1);
            }
        }
        StringBuilder sb=new StringBuilder();
        for(int key:map.keySet()){
            if(map.get(key)==1){
                sb.append(key).append(" ");
            }
        }
        return sb.toString();
    }
}
